<template>
    <div class="search">
      <a-card :style="{ width: '100%' }">
        <a-button style="margin-bottom: 10px" @click="back()">返回</a-button>
        <PickTablePage ref="tablePageRef" :columns="columns" :dataList="memberList"
                       :bordered="true" />
      </a-card>
    </div>
  </template>

  <script setup lang='ts'>
  import { ref,  onMounted } from "vue"
  import { useRouter, useRoute } from 'vue-router';
  import { PickTablePage } from '@pickmall/ui-v3-components'
  import {   ColumnsDataRule } from '@/types/global';
  import { getDistributionGroup } from '@/api/operation';
  const memberList = ref<any>([]);
  const tablePageRef = ref('');
  const route = useRoute();
  const apiParams = ref({
    id: route.query.id ? route.query.id : null
  });

  const columns: ColumnsDataRule[] = [
    {
      title: '昵称',
      dataIndex: 'memberName',
    },
    {
      title: '销售额',
      dataIndex: 'distributionOrderPrice',
      currency:true,
    },
    {
      title: '订单量',
      dataIndex: 'distributionOrderCount',
    },
  ]
  const router = useRouter()
  // 返回
  const back = () => {
    router.push({ name: 'distrbution-staff' })
  }
  async function init() {
    const res = await getDistributionGroup(route.query.id || '');
    if (res.data.success) {
      memberList.value = res.data.result.records
    }
  }
  onMounted(() => {
    init()
  })
  </script>

}

  <style lang="less" scoped>
  
  </style>
  